﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Admin_RelationConfig_Config :PageBase
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected override bool CheckPermission()
    {
        return Permission.GetManagerPermission();
    }

    protected void btnAdd_Click(object sender, EventArgs e)
    {
        if (lb_RelationList.SelectedItem == null || lb_NoHaveBeRelationList.SelectedItem==null)
        {
            return;
        }
        int eId = int.Parse(lb_RelationList.SelectedItem.Value);
        Guid mId = Guid.Parse(lb_NoHaveBeRelationList.SelectedItem.Value);

        PKURG.CostSplit.Business.Relation.Relation_Project(eId, mId, "hanmeimei");
        Refresh();
    }
    protected void btnDel_Click(object sender, EventArgs e)
    {
        if (lb_RelationList.SelectedItem == null || lb_HaveBeRelationList.SelectedItem==null)
        {
            return;
        }
        int eId = int.Parse(lb_RelationList.SelectedItem.Value);
        Guid mId = Guid.Parse(lb_HaveBeRelationList.SelectedItem.Value);

        PKURG.CostSplit.Business.Relation.UnRelation_Project(eId, mId);
        Refresh();
    }
    protected void lb_RelationList_SelectedIndexChanged(object sender, EventArgs e)
    {
        Refresh();
    }

    private void Refresh()
    {
        lb_HaveBeRelationList.DataBind();
        lb_NoHaveBeRelationList.DataBind();
    }
}